﻿using System;
using System.Linq;
using System.Web;

public partial class site : System.Web.UI.MasterPage
{
    dulieuDataContext ds=new dulieuDataContext();
    protected void Page_Load(object sender, EventArgs e)
    {
        if(Request.Cookies["username"]!=null)
        {
            if (lblthongbao != null) lblthongbao.Text = "Xin chào:  " + Request.Cookies["username"].Value;
            rpt_thong_tin_cong_ty.DataSource = from o in ds.InfoCompanies where o.id == 1 select o;
            rpt_thong_tin_cong_ty.DataBind();
        }
        else
        {
            Response.Redirect("DangNhap.aspx");
        }
    }

    protected void Unnamed1_Click(object sender, EventArgs e)
    {
        HttpCookie ckusername = new HttpCookie("username", "");
        ckusername.Expires = DateTime.Now;
        Response.Cookies.Add(ckusername);
         HttpCookie Admin = new HttpCookie("Admin", "");
        Admin.Expires = DateTime.Now;
        Response.Cookies.Add(Admin);
        Response.Redirect("DangNhap.aspx");
    }
}
